package com.xuelangyun.dao;

import com.xuelangyun.po.UserInfo;
import org.springframework.stereotype.Repository;

/** @Version 1.0 @Author:xinyan @Date:2022/4/16 @Content: */

/*
 * Dao: 数据访问层：数据库的增删改查操作
 * */

/**
 * 通过用户名称查询用户对象
 *
 * @param
 * @return
 */
@Repository
public class UserInfoDao {
  private final String USERNAME = "admin";
  private final String USERPWD = "admin";

  /**
   * 通过用户名称查询用户对象
   *
   * @param userName
   * @return
   */
  public UserInfo queryUserByName(String userName) {
    UserInfo userInfo = null;

    if (!USERNAME.equals(userName)) {
      return null;
    }
    userInfo = new UserInfo();
    userInfo.setUserName(userName);
    userInfo.setUserPwd(USERPWD);

    return userInfo;
  }
}
